home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 October / macformat-005.iso / Shareware City / Developers / Incognito 1.2ß2 src Folder / Incognito ƒ / init / ShowINIT.a < prev   
Encoding:
Text File  |  1993-12-26  |  15.5 KB  |  541 lines  |  [TEXT/MPS ]

  1. ; File: ShowINIT.a
  2. ; Last Modified: Sunday, November 26, 1989 05:07:56 PM
  3. ;------------------------------------------------------------------------------------------------
  4. ;
  5. ;    INIT notification routine
  6. ;     by Paul Mercer, Darin Adler, Paul Snively,
  7. ;        Frédéric Miserey, and Alex Rosenberg from an idea by Steve Capps
  8. ;
  9. ;    Created:  6/7/87  PM    - First version.
  10. ;    Modified: 6/15/87 PM    - Changed to standard (Pascal) calling conventions.
  11. ;          6/20/87 PM    - Fixed color & Finder bug on Mac II.
  12. ;          6/22/87 DBA    - Improved handling of QuickDraw.
  13. ;          6/29/87 DBA    - Used scratch8 to avoid conflict with “Easy Access”.
  14. ;          6/30/87 DBA    - Changed to a 4-byte scheme with “checksum”.
  15. ;          6/30/87 PFS    - Separated into ShowINIT and InnerShowINIT.
  16. ;          7/1/87  DBA    - Fixed stack bug and switched to CurApName+.
  17. ;          7/2/87  PM    - Added check for old signature in ApplScratch for
  18. ;                   backword compatibility (TMON Startup).
  19. ;          7/3/87  PM    - Removed _SysBeep in ErrorExit since it causes a crash.
  20. ;                   Also changed ICN# plotter to srcOr mode for Blinker.
  21. ;          7/13/87 PM    - Fixed a3 trashing bug in InnerShowINIT - exit code left
  22. ;                   word on stack (reported by D. Dunham).
  23. ;          7/21/87 PM    - Due to popular demand, InitGraf is no longer being called.
  24. ;                   This avoids the gamma correction problem with Startupscreens
  25. ;                   getting  “washed out” by ShowINIT though someone else is still
  26. ;                   bound to call InitGraf sooner or later (i.e. InitWindows).
  27. ;          7/29/87 PM    - Put InitGraf back in; this is required (reported by C. Derossi
  28. ;                   at Apple Tech Support).  Took out GetPort/SetPort.
  29. ;        10/06/87  PM    - Set CurrentA5 properly.  Rearranged myVars.
  30. ;        12/28/87  PM    - Major revision to accomodate future INIT31 based ShowINIT.
  31. ;        07/14/88  PM    - Major revision to get rid of above 'accomodations'.
  32. ;                   Added color icon 'cicn' support and fixed beep crash.
  33. ;                   Removed support for old signature.
  34. ;        11/25/89 FCM    - Added Y dimension support, icl48 support to get rid of 'obsolete' cicns
  35. ;        3/27/90  AMR    - 'cicn's were not being drawn in their native size.
  36. ;
  37. ;------------------------------------------------------------------------------------------------
  38.  
  39.         INCLUDE    'Traps.a'
  40.         INCLUDE    'QuickEqu.a'
  41.         INCLUDE    'SysEqu.a'
  42.         INCLUDE    'ToolEqu.a'
  43.  
  44.         BLANKS  ON
  45.         STRING  ASIS
  46.  
  47. True        equ    1
  48. False        equ    0
  49.  
  50. Debug        equ    True
  51. ;Debug        equ    False
  52.  
  53. myVCheck    equ    CurApName+32-8        ; a GREAT place to store 8 bytes (it was Darin's idea)
  54. myV        equ    myVCheck+2
  55. myH        equ    myV+2
  56. myHCheck    equ    myH+2            ; a simple checksum of myH to determine first-timeness
  57. firstX        equ    8            ; X coordinate of first icon to be drawn
  58. bottomEdge    equ    8+32            ; this far from bottom of screen
  59. iconWidth    equ    32            ; size of icon (square normally)
  60. visBuff        equ    8            ; a visual buffer between icons of 8 pixels
  61. defaultMoveX    equ    iconWidth+visBuff    ; x default amount to move icons (40 pixels)
  62. defaultMoveY    equ    40            ; y icon line height
  63. checksumConst    equ    $1021            ; constant used for computing checksum
  64. minColorDepth    equ    4            ; minimum bits/pixel for drawing color icons
  65.  
  66. chunky        equ    0
  67.  
  68. maskOffset    equ    128            ; offset to mask in ICN#
  69. iconRowBytes    equ    32/8            ; 32/8 bits
  70.  
  71. hasCQDBit    equ    6            ; this bit in ROM85 is cleared if Color QuickDraw is available
  72.  
  73. iconID        equ    6+4            ; positive stackframe objects
  74. moveX        equ    4+4
  75. showINITArgs    equ    4
  76.  
  77. iconPtrHdl    equ    6+4
  78. initDrawArgs    equ    6
  79.  
  80. iclPtrHdl    equ    12+4
  81. iclDepth    equ    10+4
  82. initDrawXArgs    equ    initDrawArgs+6
  83.  
  84. myVars        RECORD    0,DECREMENT
  85. saveA5        ds.l    1
  86. localA5        ds.l    1
  87. thePort        ds.l    1            ; my own QuickDraw (required!)
  88.         ds.b    grafSize-4        ;  other QuickDraw globals (except thePort)
  89. destRect    ds.w    4
  90. currMoveX    ds.w    1            ; holds current moveX value
  91. myBitMap    ds.b    bitMapRec
  92. myPort        ds.b    portRec
  93. varsSize    equ    *
  94.         ENDR
  95.  
  96.  
  97. ;------------------------------------------------------------------------------------------------
  98. ;
  99. ;    Displays the ICN# (cicn when in 4 bit mode or higher) specified by iconID and
  100. ;     move the pen horizontally by moveX.
  101. ;    Pass a -1 in moveX to move the standard amount, moveX should be 40 for most ICN#'s
  102. ;
  103. ;    PROCEDURE ShowINIT(iconID: Integer; moveX: Integer); EXTERNAL
  104. ;
  105. ;    pascal void ShowINIT(iconID, moveX)
  106. ;        short iconID, moveX;
  107. ;        extern;
  108. ;
  109. ;------------------------------------------------------------------------------------------------
  110. ShowINIT:    PROC    EXPORT
  111.         IMPORT    INITDraw1Bit, INITDrawCQD,INITDrawXBit
  112.  
  113.         link    a6,#0            ; create stack frame
  114.         movem.l    d3-d7/a2-a4,-(sp)    ; save standard registers
  115.  
  116.         btst.b    #hasCQDBit,ROM85    ; try to get a color icon if CQD exists
  117.         beq.s    ShowINITCQD        ; I could use SysEnvirons but I don't want to
  118. ShowINIT1Bit
  119.         subq.w    #4,sp            ; try to get the icon resource
  120.         move.l    #'ICN#',-(sp)
  121.         move.w    iconID(a6),-(sp)
  122.         _GetResource
  123.         move.l    (sp)+,d0
  124.         beq.s    ShowINITError        ; can't get it, give up
  125.  
  126.         move.l    d0,-(sp)        ; leave handle on the stack for ReleaseResource
  127.         move.l    d0,a0
  128.         _HLock
  129.         move.l    (a0),a0            ; dereference
  130.         move.l    a0,-(sp)        ; icon pointer
  131.         move.w    moveX(a6),-(sp)        ; moveX
  132.         bsr    INITDraw1Bit        ; draw
  133.         _ReleaseResource        ; release the resource
  134.  
  135. ShowINITExit:
  136.         movem.l    (sp)+,d3-d7/a2-a4    ; restore registers
  137.         unlk    a6            ; ditch stack frame
  138.         move.l    (sp)+,a0        ; get return address
  139.         addq.l    #showINITArgs,sp    ; ditch incoming arguments
  140.         jmp    (a0)            ; return to caller
  141.  
  142. ShowINITError:
  143.         IF    Debug THEN
  144.         move.w    #1,-(sp)        ; just beep
  145.         _SysBeep
  146.         ENDIF
  147.         bra.s    ShowINITExit
  148.  
  149.  
  150. ShowINITCQD:    
  151.         move.l    #$40008,d2
  152.         move.l    #'icl8',d3
  153.         move.l    #'icl4',d4
  154.         move.l    MainDevice,a0        ; get handle to main device
  155.         move.l    (a0),a0            ; dereference
  156.         move.l    gdPMap(a0),a0        ; get its pixmap handle
  157.         move.l    (a0),a0            ; dereference it
  158.         cmp.w    #minColorDepth,pmPixelSize(a0)    ; is it deep enough for us to draw in color?
  159.         blt.s    ShowINIT1Bit            ;  no
  160.         bne.s    noSwapOrder            ; is depth 4 ?
  161.         swap    d2                ; yes - swap icl_ search order
  162.         exg    d3,d4
  163. noSwapOrder:
  164.         subq.w    #4,sp
  165.         move.l    d3,-(sp)
  166.         move.w    iconID(a6),-(sp)
  167.         _GetResource
  168.         move.l    (sp)+,d1
  169.         beq.s    SearchNext
  170. FoundIc:
  171.         subq.w    #4,sp
  172.         move.l    #'ICN#',-(sp)
  173.         move.w    iconID(a6),-(sp)
  174.         _GetResource
  175.         move.l    (sp)+,d0
  176.         bne.s    FoundCompanion
  177.         
  178.         move.l    d1,-(sp)
  179.         _ReleaseResource
  180.         bra.s    ShowINITError
  181. FoundCompanion:        
  182.         move.l    d1,-(sp)        ; leave handle on the stack for ReleaseResource
  183.         move.l    d0,-(sp)        ; leave handle on the stack for ReleaseResource
  184.         move.l    d0,d3
  185.         
  186.         move.l    d1,a0
  187.         _HLock
  188.         move.l    (a0),a0            ; dereference
  189.         move.l    a0,-(sp)        ; icl_ pointer
  190.         move.w    d2,-(sp)        ; icl_ depth
  191.         move.l    d3,a0
  192.         _HLock
  193.         move.l    (a0),a0            ; dereference
  194.         move.l    a0,-(sp)        ; icon pointer
  195.         move.w    moveX(a6),-(sp)        ; moveX
  196.         bsr    INITDrawXBit        ; draw
  197.         _ReleaseResource        ; release the resource
  198.         _ReleaseResource        ; release the resource
  199.         bra    ShowINITExit
  200. SearchNext:
  201.         swap    d2
  202.         subq.w    #4,sp
  203.         move.l    d4,-(sp)
  204.         move.w    iconID(a6),-(sp)
  205.         _GetResource
  206.         move.l    (sp)+,d1
  207.         bne.s    FoundIc
  208.  
  209.         subq.w    #4,sp            ; can a color icon be found?
  210.         move.w    iconID(a6),-(sp)
  211.         _GetCIcon
  212.         move.l    (sp)+,d0
  213.         beq    ShowINIT1Bit        ;  no, so try for regular icon
  214.  
  215.         move.l    d0,-(sp)        ; leave handle on the stack for DisposCIcon
  216.         move.l    d0,-(sp)        ; cicn handle
  217.         move.w    moveX(a6),-(sp)        ; moveX
  218.         bsr    INITDrawCQD        ; do the actual drawing
  219.         _DisposCIcon
  220.  
  221.         bra    ShowINITExit
  222.  
  223. ShowINITCredits:
  224.         dc.w    'ShowINIT by Paul Mercer'
  225.         dc.w    'Copyright 1987-1990'
  226.         dc.w    'Version of 03/27/90'
  227.         ENDPROC
  228.  
  229.  
  230. ;------------------------------------------------------------------------------------------------
  231. ;
  232. ;    Initializes the world and sets up the drawing rectangle
  233. ;
  234. ;------------------------------------------------------------------------------------------------
  235. INITInit:    PROC    EXPORT
  236.         WITH    myVars
  237.  
  238.         move.l    CurrentA5,saveA5(a6)    ; PM 10/6 save host A5
  239.         lea    localA5(a6),a5        ; PM7/21
  240.         move.l    a5,CurrentA5
  241.         pea    thePort(a6)        ; PM 10/6 use a5 reference instead of a6
  242.         _InitGraf            ; fixes color bug as per DA@ICOM
  243.         pea    myPort(a6)
  244.         _OpenPort
  245.  
  246.         move.w    myV,d0            ; get my v var
  247.         rol.w    #1,d0            ; compare against checksum
  248.         eor.w    #checksumConst,d0
  249.         cmp.w    myVCheck,d0
  250.         beq.s    ScratchVOK        ; checks, so go on test my h var
  251.  
  252.         move    myPort+portBounds+bottom(a6),d0 ; else initialize as first time
  253.         sub.w    #bottomEdge,d0
  254.         move    d0,myV
  255. ScratchVOK:
  256.         move.w    myH,d0            ; get my h var
  257.         rol.w    #1,d0            ; compare against checksum
  258.         eor.w    #checksumConst,d0
  259.         cmp.w    myHCheck,d0
  260.         beq.s    ScratchHOK        ; checks, so go on
  261.         move    #firstX,myH        ; else initialize as first time
  262. ScratchHOK:
  263.         move.l    myV,d0
  264.  
  265.         move.w    d0,d1            ; get future position
  266.         add.w    #iconWidth,d1        ; compute future rect right
  267.         cmp.w    myPort+portBounds+right(A6),d1 ; compare to main screen right
  268.         blt.s    DontChangeLine        ; smaller - do nothing
  269.  
  270.         move.w    myV,d0            ; decrement Y value
  271.         subi.w    #defaultMoveY,d0
  272.         move.w    d0,myV
  273.         moveq    #firstX,D0
  274.         move    d0,myH            ; set X to initial value
  275.  
  276.         move.l    myV,d0
  277. DontChangeLine:
  278.         move.l    d0,destRect(a6)
  279.         move.l    d0,destRect+botRight(a6)
  280.         add.w    #iconWidth,destRect+right(a6)
  281.         add.w    #iconWidth,destRect+bottom(a6)
  282.  
  283.         move.w    #defaultMoveX,currMoveX(a6)    ; establish a default
  284.                             ; INITDrawCQD changes this
  285.         rts
  286.  
  287.         ENDWITH
  288.         ENDPROC
  289.  
  290.  
  291. ;------------------------------------------------------------------------------------------------
  292. ;
  293. ;    Cleans up the work done by INITInit and advances the icon drawing position
  294. ;
  295. ;------------------------------------------------------------------------------------------------
  296. INITCleanup:    PROC    EXPORT
  297.         WITH    myVars
  298.  
  299.         move.w    myH,d0            ; get current position
  300.         move.w    moveX(a6),d1        ; get delta x
  301.         bpl.s    NotDefault        ; not default (-1)
  302.         move.w    currMoveX(a6),d1    ; default - set in INITInit and INITDrawCQD
  303. NotDefault:
  304.         add.w    d1,d0            ; increment icon position
  305.         move.w    d0,myH            ;  and save in ‘global’
  306. computeChecksum:
  307.         rol.w    #1,d0            ; recompute h checksum
  308.         eor.w    #checksumConst,d0
  309.         move.w    d0,myHCheck        ;  and save it
  310.  
  311.         move    myV,d0            ; same for v checksum
  312.         rol.w    #1,d0
  313.         eor.w    #checksumConst,d0
  314.         move.w    d0,myVCheck
  315. Exit:
  316.         pea    myPort(a6)
  317.         _ClosePort
  318.         ; *** (DBA) I think that QuickDraw leaves handles around.
  319.         ; *** (DBA) Too bad we can't get rid of them...
  320.         move.l    saveA5(a6),a5        ; PM 10/6 restore host A5
  321.         move.l    a5,CurrentA5
  322.         rts
  323.  
  324.         ENDWITH
  325.         ENDPROC
  326.  
  327.  
  328. ;------------------------------------------------------------------------------------------------
  329. ;
  330. ;    display the ICN# pointed to by iconPtr and move the pen horizontally by moveX
  331. ;     pass a -1 in moveX to move the standard amount, moveX should be 40 for most ICN#'s
  332. ;
  333. ;    PROCEDURE INITDraw1Bit(iconPtr: ICONListPtr; moveX: Integer); EXTERNAL
  334. ;
  335. ;    pascal void INITDraw1Bit(iconPtr, moveX)
  336. ;        ICONList *iconPtr;
  337. ;        short moveX;
  338. ;        extern;
  339. ;
  340. ;------------------------------------------------------------------------------------------------
  341. INITDraw1Bit:    PROC    EXPORT
  342.         IMPORT    INITInit, INITCleanup:CODE
  343.         WITH    myVars
  344.  
  345.         link    a6,#varsSize        ; create stack frame
  346.         movem.l    d3-d7/a2-a4,-(sp)    ; save standard registers
  347.         bsr    INITInit        ; initialize for drawing
  348.  
  349.         move.l    iconPtrHdl(a6),a3    ; get ICN# pointer
  350.         lea    myBitMap(a6),a4        ; point to bitmap structure
  351.         move.l    a3,baseAddr(a4)        ; fill it out
  352.         add.l    #maskOffset,baseAddr(a4) ; skip to mask
  353.         move    #iconRowBytes,rowBytes(a4)
  354.         moveq    #0,d0
  355.         move.l    d0,bounds(a4)        ; 0,0 topleft
  356.         move.l    #(iconWidth<<16)+iconWidth,bounds+bottom(a4) ; 32,32 botright
  357.         
  358.         move.l    a4,-(sp)        ; punch hole with mask
  359.         lea    myPort(a6),a2        ; get the desk port
  360.         pea    portBits(a2)        ;  for its portbits
  361.         pea    srcRect
  362.         pea    destRect(a6)
  363.         move    #srcBic,-(sp)        ; punch a hole
  364.         clr.l    -(sp)            ; no clip region
  365.         _CopyBits
  366.  
  367.         sub.l    #128,baseAddr(a4)
  368.         move.l    a4,-(sp)        ; now draw (or) icon
  369.         pea    portBits(a2)
  370.         pea    srcRect
  371.         pea    destRect(a6)
  372.         move    #srcOr,-(sp)
  373.         clr.l    -(sp)
  374.         _CopyBits
  375.  
  376.         bsr    INITCleanup        ; cleanup, advance icon location
  377.         movem.l    (sp)+,d3-d7/a2-a4    ; restore registers
  378.         unlk    a6            ; ditch stack frame
  379.         move.l    (sp)+,a0        ; get return address
  380.         addq.l    #initDrawArgs,sp    ; ditch incoming
  381.         jmp    (a0)            ; back to caller
  382.  
  383. srcRect:    dc.w    0,0,32,32        ; for copybits
  384.  
  385.         ENDWITH
  386.         ENDPROC
  387.  
  388.  
  389. ;------------------------------------------------------------------------------------------------
  390. ;
  391. ;    display the Icl pointed to by iclPtr and move the pen horizontally by moveX
  392. ;     pass a -1 in moveX to move the standard amount, moveX should be 40 for most ICN#'s
  393. ;
  394. ;    PROCEDURE INITDrawXBit(iclPtr: icl_Ptr; iclDepth: Integer; 
  395. ;                iconPtr: ICONListPtr; moveX: Integer); EXTERNAL
  396. ;
  397. ;    pascal void INITDrawXBit(iconPtr, moveX)
  398. ;        icl_Ptr *iclPtr;
  399. ;        short iclDepth;
  400. ;        ICONList *iconPtr;
  401. ;        short moveX;
  402. ;        extern;
  403. ;
  404. ;------------------------------------------------------------------------------------------------
  405. INITDrawXBit:    PROC    EXPORT
  406.         IMPORT    INITInit, INITCleanup:CODE
  407.         WITH    myVars
  408.  
  409.         
  410.         link    a6,#varsSize        ; create stack frame
  411.         movem.l    d3-d7/a2-a4,-(sp)    ; save standard registers
  412.         
  413.         subq.w    #4,sp
  414.         _NewPixMap
  415.         move.l    (sp)+,d0
  416.         bne.s    pixIsGood
  417.         
  418.         move.l    iconPtrHdl(a6),-(sp)
  419.         move    moveX(a6),-(sp)
  420.         bsr    INITDraw1Bit
  421.         bra    quickEnd
  422. pixIsGood:    
  423.         move.l    d0,a2
  424.         
  425.         bsr    INITInit        ; initialize for drawing
  426.  
  427.         movea.l    a2,a0
  428.         _HLock
  429.         movea.l    (a2),a0
  430.         movea.l    pmTable(a0),a0
  431.         _DisposHandle
  432.         subq.w    #4,sp
  433.         move.l    #'clut',-(sp)
  434.         move.w    iclDepth(a6),-(sp)
  435.         _RGetResource
  436.         movea.l    (a2),a0
  437.         move.l    (sp)+,pmTable(a0)
  438.         
  439.         move.l    iclPtrHdl(a6),pmBaseAddr(a0)
  440.         moveq    #iconRowBytes,d0
  441.         move.w    iclDepth(a6),d1
  442.         mulu    d1,d0
  443.         bset.l    #15,d0
  444.         move.w    d0,pmRowBytes(a0)
  445.         moveq    #0,d0
  446.         move.l    d0,pmBounds(a0)        ; 0,0 topleft
  447.         move.l    #(iconWidth<<16)+iconWidth,pmBounds+bottom(a0) ; 32,32 botright
  448.         move.w    #chunky,pmPixelType(a0)
  449.         move.w    d1,pmPixelSize(a0)
  450.         move.w    #1,pmCmpCount(a0)
  451.         move.w    d1,pmCmpSize(a0)
  452.         
  453.         lea    myBitMap(a6),a4        ; point to bitmap structure
  454.         move.l    iconPtrHdl(a6),baseAddr(a4) ; fill it out with ICN# pointer
  455.         add.l    #maskOffset,baseAddr(a4) ; skip to mask
  456.         move    #iconRowBytes,rowBytes(a4)
  457.         moveq    #0,d0
  458.         move.l    d0,bounds(a4)        ; 0,0 topleft
  459.         move.l    #(iconWidth<<16)+iconWidth,bounds+bottom(a4) ; 32,32 botright
  460.         
  461.         move.l    (a2),d0
  462.         move.l    d0,-(sp)
  463.         move.l    a4,-(sp)        ; punch hole with mask
  464.         pea    myPort+portBits(a6)    ; get the desk port portbits
  465.         pea    srcRect
  466.         pea    srcRect
  467.         pea    destRect(a6)
  468.         _CopyMask
  469.         
  470.         moveq    #0,d0
  471.         _NewHandle
  472.         movea.l    (a2),a1
  473.         move.l    a0,pmTable(a1)
  474.         move.l    a2,-(sp)
  475.         _DisposPixMap
  476.  
  477.         bsr    INITCleanup        ; cleanup, advance icon location
  478. quickEnd    movem.l    (sp)+,d3-d7/a2-a4    ; restore registers
  479.         unlk    a6            ; ditch stack frame
  480.         move.l    (sp)+,a0        ; get return address
  481.         adda.w    #initDrawXArgs,sp    ; ditch incoming
  482.         jmp    (a0)            ; back to caller
  483.  
  484. srcRect:    dc.w    0,0,iconWidth,iconWidth    ; for copymask
  485.  
  486.         ENDWITH
  487.         ENDPROC
  488.  
  489.  
  490. ;------------------------------------------------------------------------------------------------
  491. ;    same as above except with color icon handle
  492. ;------------------------------------------------------------------------------------------------
  493. INITDrawCQD:    PROC    EXPORT
  494.         IMPORT    INITInit, INITCleanup:CODE
  495.         WITH    myVars
  496.  
  497.         link    a6,#varsSize        ; create stack frame
  498.         movem.l    d3-d7/a2-a4,-(sp)    ; save standard registers
  499.         bsr    INITInit        ; initialize for drawing
  500.  
  501.         move.l    iconPtrHdl(a6),a0
  502.         move.l    (a0),a0
  503.         move.w    pmBounds+right(a0),d0    ; (right - left - iconWidth) + destRect.right
  504.         move.w    pmBounds+left(a0),d1
  505.         sub.w    d1,d0
  506.         
  507.         move.w    #visBuff,d1
  508.         move.w    d0,currMoveX(a6)
  509.         add.w    d1,currMoveX(a6)    ; (right - left) -> currMoveX
  510.         
  511.         move.w    #iconWidth,d1
  512.         subx.w    d1,d0
  513.         move.w    destRect+right(a6),d1
  514.         addx.w    d0,d1
  515.         move.w    d1,destRect+right(a6)
  516.         move.w    pmBounds+bottom(a0),d0    ; (bottom - top - iconWidth) + destRect.bottom
  517.         move.w    pmBounds+top(a0),d1
  518.         sub.w    d1,d0
  519.         move.w    #iconWidth,d1
  520.         subx.w    d1,d0
  521.         move.w    destRect+bottom(a6),d1
  522.         addx.w    d0,d1
  523.         move.w    d1,destRect+bottom(a6)
  524.  
  525.         pea    destRect(a6)        ; destination rect
  526.         move.l    iconPtrHdl(a6),-(sp)    ; cicn handle
  527.         _PlotCIcon            ; draw it
  528.  
  529.         bsr    INITCleanup        ; cleanup, advance icon location
  530.         movem.l    (sp)+,d3-d7/a2-a4    ; restore registers
  531.         unlk    a6            ; ditch stack frame
  532.         move.l    (sp)+,a0        ; get return address
  533.         addq.l    #initDrawArgs,sp    ; ditch incoming
  534.         jmp    (a0)            ; back to caller
  535.  
  536.         ENDWITH
  537.         ENDPROC
  538.  
  539.  
  540.         END
  541.